package com.jk.garden1.controller;

import com.jk.garden1.entity.SubscribeEntity;
import com.jk.garden1.entity.VisitantEntity;
import com.jk.garden1.service.SubscribeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 预约管理表
 */
@RestController
@RequestMapping("subscribe")
public class SubscribeController {
    @Autowired
    private SubscribeService subscribeService;
    /**
     * 查询全部
     */
    @RequestMapping("selectSubscribeList")
    public List<SubscribeEntity> selectSubscribeList(){
        return subscribeService.selectSubscribeList();
    }
    /**
     * 删除
     */
    @RequestMapping("delId")
    public void delId(Integer subscribeid){
        subscribeService.delId(subscribeid);
    }
    /**
     * 新增预约
     */
    @RequestMapping("addSubscribe")
    public void addSubscribe(SubscribeEntity subscribeEntity){

        subscribeService.addSubscribe(subscribeEntity);
    }
    /**
     * 查询即将到访
     */
    @RequestMapping("findCountList")
    public List<SubscribeEntity> findCountList(SubscribeEntity subscribeEntity){
       return subscribeService.findCountList(subscribeEntity);
    }
    /**
     * 查询到访管理表classify=1
     */
    @RequestMapping("findClassify")
    public List<VisitantEntity> findClassify(VisitantEntity visitantEntity){
        return subscribeService.findClassify(visitantEntity);
    }
    @PostMapping("sendNote")
    public String sendNote(@RequestBody String subscribeids[]){
        return subscribeService.sendNote(subscribeids);
    }

    /**
     * es高亮查询
     */
    @RequestMapping("querySubList")
    public Object querySubList(SubscribeEntity subscribe){
       return  subscribeService.querySubList(subscribe);
    }
    /**
     * 查询今日预约人数
     */
    @RequestMapping("findSubCount")
    public List<SubscribeEntity>findSubCount(){
        return subscribeService.findSubCount();
    }
    /**
     * 查询今日临时来访人数
     */
    @RequestMapping("findLinShiCount")
    public List<SubscribeEntity>findLinShiCount(){
        return subscribeService.findLinShiCount();
    }

}
